import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooWechatopenTemplateDraftController } from '../../../controllers';
const uctoowechatopenTemplateDraftRouter = new Router();
const wechatopenTemplateDraftController = new uctooWechatopenTemplateDraftController();

uctoowechatopenTemplateDraftRouter.post('/add', requireUser, wechatopenTemplateDraftController.add);
uctoowechatopenTemplateDraftRouter.post('/edit', requireUser, rowLevelPermission('uctoo/wechatopen_template_draft'), wechatopenTemplateDraftController.edit);
uctoowechatopenTemplateDraftRouter.post('/del', requireUser, rowLevelPermission('uctoo/wechatopen_template_draft'), wechatopenTemplateDraftController.delete);

//For getting wechatopenTemplateDraft with permission control
uctoowechatopenTemplateDraftRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/wechatopen_template_draft'), wechatopenTemplateDraftController.getSingle);
uctoowechatopenTemplateDraftRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/wechatopen_template_draft'), wechatopenTemplateDraftController.getMany);
uctoowechatopenTemplateDraftRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/wechatopen_template_draft'), wechatopenTemplateDraftController.getMany);

//#endregion AutoCreateCode
export default uctoowechatopenTemplateDraftRouter;
